<template>
  <a-card :bordered="false" :style="{ marginTop: '12px',height:'450px' }">
    <span slot="title"> <a-icon type="tags" style="color:#3393FC;margin-right: 5px" theme="filled"/>流程中心</span>
    <a slot="extra" @click="loadMore('/bpm/task/MyTaskList')">更多</a>
    <template>
      <a-tabs  @change="callback">
        <a-tab-pane tab="待办" key="1">
          <my-running-task-list ref="runTaskList" @ok="runOk"></my-running-task-list>
        </a-tab-pane>
        <a-tab-pane tab="我的抄送" key="2">
          <my-cc-his-process-list ref="ccProcessList"></my-cc-his-process-list>
        </a-tab-pane>
      </a-tabs>
    </template>
  </a-card>
</template>

<script>
  import MyRunningTaskList from './MyRunningTaskList'
  import MyCcHisProcessList from './MyCcHisProcessList'

  export default {
    name: 'EoaCmsMyProcess',
    components: {
      MyRunningTaskList,
      MyCcHisProcessList,
    },
    data () {
      return {
        processUpdate: false,
      }
    },
    methods: {
      loadMore(path){
        let query={}
        this.$router.push({ path: path,query:query})
      },
      runOk(){
        this.$refs.applyProcessList.loadData();
        this.processUpdate=true;
      },
      callback(key) {
        if(key=='2'&&this.processUpdate){
          this.$refs.ccProcessList.loadData()
          this.processUpdate=false;
        }
      }
    }
  }
</script>

<style scoped>

</style>